# 打印空心三角形
row = int(input("请输入要打印的行数："))
k = 1
for x in range(1, row + 1):
    for y in range(1, x + 1):
        if x != row:
            if y == 1 or y == x:
                print("*", end="")
            else:
                print(" ", end="")
        else:
            while k <= x:
                print("*", end="")
                k += 1
    print("\n")